
#ifndef _TTG_SERVICES_PUBLISHERINFO_
#define _TTG_SERVICES_PUBLISHERINFO_
#include "Common/Definitions.h"

#include "Common/Structures.h"
#include "Subscribers.h"

namespace ttg
{
	namespace services
	{
		//Contains information about one publisher avatar.
		class PublisherInfo :public structures::NamedObject
		{
			private:
				std::list<SubscriberInfo *> infos;	//list of all subscribers
			public:
				PublisherInfo(const char *name);
				//Adds subscriber.
				void addSubscriber(Subscriber *ss, void (*d)(Subscriber *ss, Event *ev));
				//Removes subscriber.
				void removeSubscriber(Subscriber *ss);
				//Sends event to all subscribers.
				void sendEvent(Event *ev);
				//Releases info only.
				~PublisherInfo();
		};
	}
}

#endif
